package com.taotao.controller;

import com.taotao.common.pojo.EUDataGridResult;
import com.taotao.common.pojo.TaotaoResult;
import com.taotao.common.utils.ExceptionUtil;
import com.taotao.pojo.TbContent;
import com.taotao.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by zhaoliang on 2017/7/16.
 */
@Controller
@RequestMapping("/content")
public class ContentController {
    @Autowired
    private ContentService service;

    @RequestMapping("/query/list")
    @ResponseBody
    public EUDataGridResult getItemList(Long categoryId, Integer page, Integer rows) {
        EUDataGridResult result = service.queryContentCategory(categoryId,page,rows);
        return result;
    }

    @RequestMapping("/save")
    @ResponseBody
    public TaotaoResult insertContent(TbContent content) {
        TaotaoResult result = service.insertContent(content);
        return result;
    }

}
